Subject: Re: interrupt in SAS/C 6.51
From: [email-masked] (Doug Walker)
Date: Mon, 7 Mar 1994 14:34:41 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]>, [email-masked] (Darrell Grainger) writes:
|> Now if I create the function VertBServer using assembler I can get this to
|> work fine but what I would like to do (and this is just for experimental
|> purposes) is create the function VertBServer using C language. The code
|> for VertBServer is simply:
|> 
|> 	Signal(task, SIGBREAKF_CTRL_F);
|> 
|> The variable task is a global variable initialized by the main code using:
|> 
|> 	task = FindTask(NULL);
|> 
|> I've read some stuff about __interrupt in the SAS/C manual but it is not
|> entirely clear. I think I am probably not setting the Z flag when exiting
|> the VertBServer function. References to the manuals would actually be
|> appreciated.

How about this?

   struct Task *task;

   void __interrupt __saveds VertBServer(void)
   {
      Signal(task, SIGBREAKF_CTRL_F);
   }

or just add __far to the definition of the extern and you can do
away with the __saveds keyword on the function.

What's probably happening is that register A4 is not set up to
point to your near data section.  Globals are by default accessed
relative to A4 (NEAR data).  You can either add the __saveds keyword
to set up register A4, or you can access the global with FAR data
accessing by adding the __far keyword to it.